package com.ft.web.viewmodel;

import com.alibaba.fastjson.annotation.JSONField;
import com.ft.core.service.dto.BaseDto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.ArrayList;
import java.util.List;

/**
 * @copyright (C), 2015-2019, XXX有限公司
 * @fileName: TreeSelectModel
 * @author: 李阳
 * @date: 2019/6/29 11:44
 * @description: 树形选项对象
 * @history: <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class TreeSelectModel extends BaseDto {
    private static final long serialVersionUID = -1576500328146655164L;

    public TreeSelectModel() {
        this.children = new ArrayList<>();
    }

    @JSONField(ordinal = 1)
    @ApiModelProperty(value = "树范围内唯一值")
    private Object key;

    @JSONField(ordinal = 2)
    @ApiModelProperty(value = "树节点显示的内容")
    private String title;

    @JSONField(ordinal = 3)
    @ApiModelProperty(value = "默认根据此属性值进行筛选")
    private Object value;

    @JSONField(ordinal = 4)
    @ApiModelProperty(value = "父节点Id")
    private Object parentId;

    @JSONField(ordinal = 5)
    @ApiModelProperty(value = "是否可选")
    private Boolean selectable = true;

    @JSONField(ordinal = 6)
    @ApiModelProperty(value = "禁掉checkbox")
    private Boolean disableCheckbox = false;

    @JSONField(ordinal = 7)
    @ApiModelProperty(value = "是否禁用")
    private Boolean disabled = false;

    @JSONField(ordinal = 8)
    @ApiModelProperty(value = "是否是叶子节点")
    private Boolean isLeaf = false;

    @JSONField(ordinal = 9)
    @ApiModelProperty(value = "是否被选中")
    private Boolean isSelected = false;

    @JSONField(ordinal = 10)
    @ApiModelProperty(value = "完整路径编码")
    private String fullPathKey;

    @JSONField(ordinal = 11)
    @ApiModelProperty(value = "完整路径名称")
    private String fullPathName;

    @JSONField(ordinal = 10)
    @ApiModelProperty(value = "孩子节点")
    private List<TreeSelectModel> children;
}
